package cn.com.note;

import com.blankj.utilcode.util.GsonUtils;
import com.google.gson.reflect.TypeToken;

import org.junit.Test;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by sunfulin on 2019/4/8.
 */

public class 测试类 {
    private String 中() {
        return "sdsdsd";
    }

    public 测试类() {
    }

    /**
     *
     */
    @Test
    public void test() {
        System.out.println(中());
    }

    @Test
    public void test0X() {
        //0xE01D508FE1EC29C9
        //0xccf218a6d6501de0
        //0xccf218a6d6501de0

        String[] ids = {"a", "b", "c"};

        StringBuilder stringBuilder = new StringBuilder();
        for (int i = ids.length - 1; i >= 0; i--) {
            stringBuilder.append(ids[i]);
        }
        System.out.println(stringBuilder.toString());
    }

    @Test
    public void textMap() {
        Map<String, String> map = new HashMap<>();
        List<String> list = new ArrayList<>();
        list.add("测试1");
        list.add("测试2");
        String json = GsonUtils.toJson(list);
        System.out.println(json.toString());
        map.put("string", json);
        List<String> persons = GsonUtils.fromJson(json, new TypeToken<List<String>>() {
        }.getType());
        for (int i = 0; i < persons.size(); i++) {
            System.out.println(";;;_" + i + "     " + persons.get(i).toString());
        }

    }
}
